// 导入aixos的对象
import request from "@/utils/request"
import type { attrInfoModel } from "@/api/product/model/AttrModel"
import type { categoryIdsModel } from "./model/CategoryModel"
// 定义一个api管理接口
enum Api {
  //获取列表的属性
  getAttrListApi = '/admin/product/attrInfoList',
  //删除属性
  deleteAttrValueApi = '/admin/product/deleteAttr',
  //添加木属性
  AddAttrApi ='/admin/product/saveAttrInfo'
}



//获取列表数据属性的接口函数
export const reqgetAttrListData = ({ category1Id, category2Id, category3Id }:categoryIdsModel) => request.get<any,attrInfoModel[]>(Api.getAttrListApi + `/${category1Id}/${category2Id}/${category3Id}`)
//删除某个属性
export const reqDeleteAttrData = (attrId:number) => {
  return request.delete<any,null>(Api.deleteAttrValueApi+`/${attrId}`)
}
//添加某个属性
export const reqSaveAttrData = (attrInfo:attrInfoModel) => {
  return request.post<any,null>(Api.AddAttrApi,attrInfo)
  
}